<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/11/21
 * Time: 9:31
 */
namespace phpfuntions\mp_file;
class myphp_directories
{
    /**
     * chdir  函数 ：改变目录　
     * @access public
     * @return
     */
    public static function chdir ($directory) {
        return chdir( $directory);

    }


    /**
     * chroot  函数 ：改变根目录　
     * @access public
     * @return
     */
    public static function chroot ($directory) {
        return chroot( $directory);

    }


    /**
     *dir  函数 ：仿照面向对象的机制来读取一个目录
     * @access public
     * @return
     */
    public static function dir ($directory, $context = null) {
        return dir($directory, $context  );

    }


    /**
     * closedir  函数 ：关闭目录句柄　
     * @access public
     * @return
     */
    public static function closedir ($dir_handle = null) {
        return closedir($dir_handle  );

    }

    /**
     * getcwd  函数 ：获取当前工作目录　
     * @access public
     * @return
     */
    public static function getcwd () {
        return getcwd( );

    }

    /**
     *opendir  函数 ：打开目录句柄
     * @access public
     * @return
     */
    public static function opendir ($path, $context = null) {
        return opendir($path, $context  );

    }

    /**
     * readdir  函数 ：从目录句柄中读取条目　
     * @access public
     * @return
     */
    public static function readdir ($dir_handle = null) {
        return readdir($dir_handle  );

    }
    /**
     *rewinddir  函数 ：倒回目录句柄
     * @access public
     * @return
     */
    public static function rewinddir ($dir_handle = null) {
        return rewinddir( $dir_handle );

    }

    /**
     *scandir  函数 ：列出指定路径中的文件和目录
     * @access public
     * @return
     */
    public static function scandir ($directory, $sorting_order = null, $context = null) {
        return scandir( $directory, $sorting_order , $context );

    }
    /**
     *mkdir  函数：建立目录
     * @access public
     * @return
     */
    public static function mkdir ($pathname, $mode = 0777, $recursive = false, $context = null) {
        return mkdir( $pathname, $mode , $recursive , $context );

    }

    /**
     *rmdir  函数：删除目录
     * @access public
     * @return
     */
    public static function rmdir ($dirname, $context = null) {
        return rmdir( $dirname, $context );

    }


    /**
     * disk_free_space  函数：返回指定目录的剩余空间　
     * @access public
     * @return
     */
    public static function disk_free_space ($directory) {
        return disk_free_space($directory );

    }

    /**
     *disk_total_space  函数：返回指定目录的磁盘总空间大小
     * @access public
     * @return
     */
    public static function disk_total_space ($directory) {
        return disk_total_space( $directory);

    }
}